﻿using DotNetty.Transport.Channels;
using InkjetControl.codec;
using InkjetControl.NLog;
using System;
using System.Collections.Generic;
using System.Text;

namespace InkjetControl.services.resolvers
{
    public class PingMessageResolver : IResolver
    {
        public Message Resolve( Message message)
        {
            Log.Logger.Debug("Srv Ping Resolve: [ sessionID:{0}], ", message.SessionId);
            Message pong = new Message
            {
                SessionId = message.SessionId,
                MessageType = MessageType.PONG,
                MachineCode = message.MachineCode
            };
            return pong;
        }

        public bool Support(Message message)
        {
            return MessageType.PING == message.MessageType;
        }
    }
}
